﻿using System;
using System.Collections.Generic;
using System.ComponentModel;

namespace HalconDotNet
{
	// Token: 0x0200007D RID: 125
	[EditorBrowsable(EditorBrowsableState.Never)]
	public class HDevDisposeHelper : IDisposable
	{
		// Token: 0x06001DAF RID: 7599 RVA: 0x000B4BBA File Offset: 0x000B2DBA
		public HDevDisposeHelper()
		{
			this.mDisposables = new List<IDisposable>();
		}

		// Token: 0x06001DB0 RID: 7600 RVA: 0x000B4BD0 File Offset: 0x000B2DD0
		public IDisposable Add(IDisposable disposable)
		{
			for (int i = 0; i < this.mDisposables.Count; i++)
			{
				if (this.mDisposables[i] == disposable)
				{
					return disposable;
				}
			}
			this.mDisposables.Add(disposable);
			return disposable;
		}

		// Token: 0x06001DB1 RID: 7601 RVA: 0x000B4C14 File Offset: 0x000B2E14
		public IDisposable Take(IDisposable disposable)
		{
			for (int i = 0; i < this.mDisposables.Count; i++)
			{
				if (this.mDisposables[i] == disposable)
				{
					this.mDisposables.RemoveAt(i);
					return disposable;
				}
			}
			return disposable;
		}

		// Token: 0x06001DB2 RID: 7602 RVA: 0x000B4C58 File Offset: 0x000B2E58
		void IDisposable.Dispose()
		{
			for (int i = 0; i < this.mDisposables.Count; i++)
			{
				this.mDisposables[i].Dispose();
			}
			this.mDisposables.Clear();
		}

		// Token: 0x06001DB3 RID: 7603 RVA: 0x000B4C97 File Offset: 0x000B2E97
		public HObjectVector Add(HObjectVector disposable)
		{
			return (HObjectVector)this.Add(disposable);
		}

		// Token: 0x06001DB4 RID: 7604 RVA: 0x000B4CA5 File Offset: 0x000B2EA5
		public HObjectVector Take(HObjectVector disposable)
		{
			return (HObjectVector)this.Take(disposable);
		}

		// Token: 0x06001DB5 RID: 7605 RVA: 0x000B4CB3 File Offset: 0x000B2EB3
		public HObject Add(HObject disposable)
		{
			return (HObject)this.Add(disposable);
		}

		// Token: 0x06001DB6 RID: 7606 RVA: 0x000B4CC1 File Offset: 0x000B2EC1
		public HObject Take(HObject disposable)
		{
			return (HObject)this.Take(disposable);
		}

		// Token: 0x06001DB7 RID: 7607 RVA: 0x000B4CCF File Offset: 0x000B2ECF
		public HTupleVector Add(HTupleVector disposable)
		{
			return (HTupleVector)this.Add(disposable);
		}

		// Token: 0x06001DB8 RID: 7608 RVA: 0x000B4CDD File Offset: 0x000B2EDD
		public HTupleVector Take(HTupleVector disposable)
		{
			return (HTupleVector)this.Take(disposable);
		}

		// Token: 0x06001DB9 RID: 7609 RVA: 0x000B4CEB File Offset: 0x000B2EEB
		public HTuple Add(HTuple disposable)
		{
			return (HTuple)this.Add(disposable);
		}

		// Token: 0x06001DBA RID: 7610 RVA: 0x000B4CF9 File Offset: 0x000B2EF9
		public HTuple Take(HTuple disposable)
		{
			return (HTuple)this.Take(disposable);
		}

		// Token: 0x04001146 RID: 4422
		protected List<IDisposable> mDisposables;
	}
}
